using System;
using System.Data;
using Utils;
using Utils.DatabaseUtils;


namespace QLCG.DAO
{
public class tblTieuLinhVucUI
{ 
	private int idTieuLinhVuc;
	public int IdTieuLinhVuc
	{
		get { return idTieuLinhVuc;}
		set { idTieuLinhVuc = value;}
	}

	private String tenTieuLinhVuc;
	public String TenTieuLinhVuc
	{
		get { return tenTieuLinhVuc;}
		set { tenTieuLinhVuc = value;}
	}

	private String maTieuLinhVuc;
	public String MaTieuLinhVuc
	{
		get { return maTieuLinhVuc;}
		set { maTieuLinhVuc = value;}
	}

	private String moTa;
	public String MoTa
	{
		get { return moTa;}
		set { moTa = value;}
	}

	private DateTime ngayTao;
	public DateTime NgayTao
	{
		get { return ngayTao;}
		set { ngayTao = value;}
	}

	private int idLinhVuc;
	public int IdLinhVuc
	{
		get { return idLinhVuc;}
		set { idLinhVuc = value;}
	}

	public tblTieuLinhVucUI() {}

	public tblTieuLinhVucUI(int idTieuLinhVuc, String tenTieuLinhVuc, String maTieuLinhVuc, String moTa, DateTime ngayTao, int idLinhVuc)
	 {
		this.idTieuLinhVuc = idTieuLinhVuc;
 		this.tenTieuLinhVuc = tenTieuLinhVuc;
 		this.maTieuLinhVuc = maTieuLinhVuc;
 		this.moTa = moTa;
 		this.ngayTao = ngayTao;
 		this.idLinhVuc = idLinhVuc;
 	}

	public int Add(String tenTieuLinhVuc, String maTieuLinhVuc, String moTa, DateTime ngayTao, int idLinhVuc)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblTieuLinhVuc_Add",tenTieuLinhVuc,maTieuLinhVuc,moTa,ngayTao,idLinhVuc);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Update(int idTieuLinhVuc, String tenTieuLinhVuc, String maTieuLinhVuc, String moTa, DateTime ngayTao, int idLinhVuc)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblTieuLinhVuc_Update",idTieuLinhVuc,tenTieuLinhVuc,maTieuLinhVuc,moTa,ngayTao,idLinhVuc);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Delete(int idTieuLinhVuc)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblTieuLinhVuc_Delete",idTieuLinhVuc);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int DeleteAll()
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblTieuLinhVuc_DeleteAll");
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public DataSet Get(int idTieuLinhVuc)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblTieuLinhVuc_Get",idTieuLinhVuc);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetAll()
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblTieuLinhVuc_GetAll");
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetByIdLinhVuc(int idLinhVuc)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblTieuLinhVuc_GetByIdLinhVuc",idLinhVuc);
			return result;
		}
		catch(Exception e) {return null; }
	}

} 
}
